import React, { useState } from 'react';
import Switch from '../Switch'
const Index = ({ id }) => {
  const [ show, setShow ]= useState(true)
  return (
    <div>
      {/* 开关 */}
      <Switch setShow={ setShow } show={ show }></Switch>
      {/* 标题是否显示 */}
      <h1>{ show && id }</h1>
    </div>
  );
}

export default Index;
